package com.bjc.principle.command;

/**
 * @program: DesignPattern
 * @description: 命令模式
 * @author: bjc
 * @create: 2021-01-04 17:43
 */
public class CommandPattern {

    public static void main(String[] args) {
        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}
